package elitech.vietnam.weatherfashion.service.unittest;

import java.io.IOException;

import junit.framework.TestCase;

import org.junit.Test;

import elitech.vietnam.weatherfashion.service.PHPSoapServiceCaller;

public class TestCommentPHPServiceCaller extends TestCase {

	PHPSoapServiceCaller service = new PHPSoapServiceCaller();

	@Test(timeout = 5000)
	public void testGetListComment() {

		// MyClass is tested

		try {
			assertNotNull(service.getListComment(10));

			// assertTrue(service.getListComment(10).size() > 0);
			// assertNotNull(service.getListComment(11));
			// assertTrue(service.getListComment(11).size() > 0);
			// assertNotNull(service.getListComment(2));
			// assertTrue(service.getListComment(2).size() > 0);
			// assertNotNull(service.getListComment(3));
			// assertTrue(service.getListComment(3).size() > 0);
			// assertNotNull(service.getListComment(1234));
			// assertTrue(service.getListComment(1234).size() == 0);
			// assertNotNull(service.getListComment(-123));
			// assertTrue(service.getListComment(-123).size() == 0);
			// // assertNotNull(service.getListComment(null));
			// // assertTrue(service.getListComment(null).size() == 0);
			//
			// assertTrue(service.getListComment(10).get(0).getDateComment() !=
			// null);
			// Calendar cal = Calendar.getInstance();
			// Date date = service.getListComment(11).get(0).getDateComment();
			// cal.setTime(date);
			// assertEquals(2013, cal.get(Calendar.YEAR));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test(timeout = 5000)
	public void testCommentOnMemberPost() {

		// MyClass is tested
//		try {
//			assertTrue(service.commentOnMemberPost(9, "abc", 9, 569,
//					"tao", "Dep tuyet voi"));

//			assertTrue(service.commentOnMemberPost(9, "abc",8, 385,
//					"tao", "dep qua suc tuong tuong"));
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}

		// assertTrue(service.commentOnMemberPost( 8, "abcd", 9, 94,
		// "jbtctio bjfryjtv", "Dep tuyet voi"));
		// assertTrue(service.commentOnMemberPost(8, "abcd", 9, 94,
		// "jbtctio bjfryjtv", "dep qua suc tuong tuong"));

		// assertTrue(service
		// .commentOnMemberPost(
		// 9,
		// "acb",
		// 31,
		// 136,
		// "Dep. That la mot buc anh vo cung dep. Xin cam on DANG va Nha Nuoc blah blah...",
		// "xau the ma bao la dep"));
		// assertTrue(service
		// .commentOnMemberPost(
		// 9,
		// "abc",
		// 31,
		// 136,
		// "Dep. That la mot buc anh vo cung dep. Xin cam on DANG va Nha Nuoc blah blah...",
		// "Xau quec a."));
	}

	@Test(timeout = 5000)
	public void testUpdatePostMember() {

		// // MyClass is tested
		// try {
		// assertTrue(service.updatePostMember(31, 130, "Na na na na Má»›i nÃ¨",
		// "member_image/abc_1385546629476.jpg"));
		// } catch (IOException e) {
		// // TODO Auto-generated catch block
		// e.printStackTrace();
		// }

	}

	@Test(timeout = 5000)
	public void testDeletePostMember() {

		// // // MyClass is tested
		// try {
		// assertTrue(service.deletePostMember(9, 94));
		// } catch (IOException e) {
		// // TODO Auto-generated catch block
		// e.printStackTrace();
		// }

	}

}
